/*
 * @Author: zhouyaxue
 * @Date: 2022-12-28 15:39:38
 * @LastEditors: zhouyaxue
 * @LastEditTime: 2023-01-10 17:21:36
 */
import 'echarts-wordcloud';
const wordCloud = (data: any) => {
  // console.log(data,'执行了词云图');
  const option = {
    backgroundColor: 'rgba(0,0,0,0)',
    series: [
      {
        type: 'wordCloud',
        gridSize: 20,
        sizeRange: [20, 40],
        rotationRange: [0, 0],
        // rotationStep: 45,
        shape: 'diamond', // cardioid 、 diamond 、 triangle-forward 、 triangle 、 star
        width: '100%',
        height: '100%',
        drawOutOfBound: false,
        textStyle: {
          color: function () {
            return 'rgba(70,215,253,' + Number(Math.random()) + ')';
          },
          emphasis: {
            shadowBlur: 10,
            shadowColor: '#2ac',
          },
        },
        data: data,
      },
    ],
  };
  // console.log(data,'执行了词云图1111');
  return option;
};

export { wordCloud };
